/**
Date: 2025-08-13
Copyright (c) 2025 Industrial Software Feature Database
*/
import { download } from '@/plugins/download';
import { originInstallationVo, originInstallationQuery, originInstallationForm } from '@/api/bomCompareTool/originInstallationList/type';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
// 上传原始装机清单
export const uploadOriginListData = (data: FormData) => {
  return request({
    url: `/biz/bom-v2/upload/original`,
    method: 'post',
    data: data,
    headers: {
      'Content-type': 'multipart/form-data'
    }
  });
};
// 分页查询原始装机清单文件列表
export const getOriginList = (query: originInstallationQuery): AxiosPromise<originInstallationVo[]> => {
  return request({
    url: `/biz/bom-v2/list/original`,
    method: 'get',
    params: query
  });
};
// 删除原始装机清单明细V2
export const originalDetailDelete = (ids) => {
  return request({
    url: `/biz/bom-v2/delete/original/detail?ids=${ids}`,
    method: 'delete'
  });
};
// 删除原始装机清单明细V2
export const originalInfoDelete = (ids) => {
  return request({
    url: `/biz/bom-v2/delete/original/info?ids=${ids}`,
    method: 'delete'
  });
};
// 查询原始装机清单信息V2
export const getOriginalInfo = (params) => {
  return request({
    url: `/biz/bom-v2/info/original`,
    method: 'get',
    params
  });
};
export const downloadFile = (ossId) => {
  return request({
    url: `/resource/oss/download/${ossId}`,
    method: 'get',
    responseType: 'blob'
  });
};
// 分页查询原始装机清单文件列表
export const getOriginDetailList = (query): AxiosPromise<[]> => {
  return request({
    url: `/biz/bom-v2/detail/original`,
    method: 'get',
    params: query
  });
};
// 生成标准装机清单V2
export const generateStandard = (query) => {
  return request({
    url: `/biz/bom-v2/generate/standard`,
    method: 'post',
    params: query
  });
};
// 查询业务事件信息
export const getEventInfo = (query) => {
  return request({
    url: `/biz/event/info`,
    method: 'get',
    params: query
  });
};
// 查询业务事件信息
export const modifyOriginal = (data) => {
  return request({
    url: `/biz/bom-v2/modify/original`,
    method: 'post',
    data
  });
};
